-- file: ch03/BookStore.hs

data BookInfo = Book Int String [String]
  deriving (Show)

data MagzineInfo = Magzine Int String [String]
  deriving (Show)

myInfo =
  Book
    9780135072455
    "Algebra of Programming"
    ["Richard Bird", "Oege de Moor"]

-- file: ch03/BookStore.hs
-- 稍后就会介绍 CustomerID 的定义
type CustomerID = Int

type ReviewBody = String

data BookReview = BookReview BookInfo CustomerID String

type BookRecord = (BookInfo, BookReview)

-- file: ch03/BookStore.hs
type CardHolder = String

type CardNumber = String

type Address = [String]

data BillingInfo
  = CreditCard CardNumber CardHolder Address
  | CashOnDelivery
  | Invoice CustomerID
  deriving (Show)
